package com.tangruojie.stream;

import com.tangruojie.entity.Author;

import java.util.List;

/**
 * 中间操作之 skip 跳过
 */
public class StreamDemo07 {

    public static void main(String[] args) {

        List<Author> authors = StreamDemoTest.getAuthors();

        authors.stream()
                .distinct()
                .sorted((author1, author2) -> author2.getAge() - author1.getAge())
                .skip(1)
                .forEach(author -> System.out.println(author.getName()));

    }

}
